package com.example.uniappspringbootstartweb.service.Imp;

import com.example.uniappspringbootstartweb.entity.Publish;
import com.example.uniappspringbootstartweb.entity.Shares;
import com.example.uniappspringbootstartweb.entity.Userlike;
import com.example.uniappspringbootstartweb.mapper.UserlikeRepository;

import com.example.uniappspringbootstartweb.service.UserlikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author DELL
 */
@Service
public class UserlikeServiceImpl implements UserlikeService {
    @Autowired
    UserlikeRepository repository;

    @Override
    public List<Userlike> getUserlikesByUserid(Long userid) {
        return repository.findAllByUserid(userid);
    }

    @Override
    public List<Userlike> getlikeByContentid(Long contentid) {
         return repository.findByLikeid(contentid);
    }

    @Override
    public Userlike save(Userlike like) {
        return repository.save(like);
    }
}



